﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using ESOL.Common.Schema;
using System.Data;
using Suzsoft.Smart.EntityCore;

namespace ESOL.Common.Entity
{
    [DataContract]
    [Serializable]
    public partial class HrEmployeeIoRecordEntity : EntityBase
    {
        public HrEmployeeIoRecordTable TableSchema
        {
            get
            {
                return HrEmployeeIoRecordTable.Current;
            }
        }

        public HrEmployeeIoRecordEntity()
        {

        }

        public HrEmployeeIoRecordEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.ReqNo = Convert.ToString(CommonFunctions.ToObject(dr["REQ_NO"]));
            this.DepartmentNo = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_NO"]));
            this.EmployeeNo = Convert.ToString(CommonFunctions.ToObject(dr["EMPLOYEE_NO"]));
            this.OutDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["OUT_DATE"]));
            this.InDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["IN_DATE"]));
            this.PlanInDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_IN_DATE"]));
            this.Reason = Convert.ToString(CommonFunctions.ToObject(dr["REASON"]));
            this.ReasonType = Convert.ToString(CommonFunctions.ToObject(dr["REASON_TYPE"]));
            this.CarNo = Convert.ToString(CommonFunctions.ToObject(dr["CAR_NO"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
            this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
            this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
            this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
            this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
            this.DeptLeaderDesc = Convert.ToString(CommonFunctions.ToObject(dr["DEPT_LEADER_DESC"]));
            this.HrLeaderDesc = Convert.ToString(CommonFunctions.ToObject(dr["HR_LEADER_DESC"]));
        }

        public HrEmployeeIoRecordEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.ReqNo = Convert.ToString(CommonFunctions.ToObject(dr["REQ_NO"]));
            this.DepartmentNo = Convert.ToString(CommonFunctions.ToObject(dr["DEPARTMENT_NO"]));
            this.EmployeeNo = Convert.ToString(CommonFunctions.ToObject(dr["EMPLOYEE_NO"]));
            this.OutDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["OUT_DATE"]));
            this.InDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["IN_DATE"]));
            this.PlanInDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PLAN_IN_DATE"]));
            this.Reason = Convert.ToString(CommonFunctions.ToObject(dr["REASON"]));
            this.ReasonType = Convert.ToString(CommonFunctions.ToObject(dr["REASON_TYPE"]));
            this.CarNo = Convert.ToString(CommonFunctions.ToObject(dr["CAR_NO"]));
            this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
            this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
            this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
            this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
            this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
            this.DeptLeaderDesc = Convert.ToString(CommonFunctions.ToObject(dr["DEPT_LEADER_DESC"]));
            this.HrLeaderDesc = Convert.ToString(CommonFunctions.ToObject(dr["HR_LEADER_DESC"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return HrEmployeeIoRecordTable.Current;
            }
        }

        #region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_ID)); }
            set { SetData(HrEmployeeIoRecordTable.C_ID, value); }
        }

        [DataMember]
        public string ReqNo
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_REQ_NO)); }
            set { SetData(HrEmployeeIoRecordTable.C_REQ_NO, value); }
        }

        [DataMember]
        public string DepartmentNo
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_DEPARTMENT_NO)); }
            set { SetData(HrEmployeeIoRecordTable.C_DEPARTMENT_NO, value); }
        }

        [DataMember]
        public string EmployeeNo
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_EMPLOYEE_NO)); }
            set { SetData(HrEmployeeIoRecordTable.C_EMPLOYEE_NO, value); }
        }

        [DataMember]
        public DateTime OutDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeIoRecordTable.C_OUT_DATE)); }
            set { SetData(HrEmployeeIoRecordTable.C_OUT_DATE, value); }
        }

        [DataMember]
        public DateTime InDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeIoRecordTable.C_IN_DATE)); }
            set { SetData(HrEmployeeIoRecordTable.C_IN_DATE, value); }
        }

        [DataMember]
        public DateTime PlanInDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeIoRecordTable.C_PLAN_IN_DATE)); }
            set { SetData(HrEmployeeIoRecordTable.C_PLAN_IN_DATE, value); }
        }

        [DataMember]
        public string Reason
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_REASON)); }
            set { SetData(HrEmployeeIoRecordTable.C_REASON, value); }
        }

        [DataMember]
        public string ReasonType
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_REASON_TYPE)); }
            set { SetData(HrEmployeeIoRecordTable.C_REASON_TYPE, value); }
        }

        [DataMember]
        public string CarNo
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_CAR_NO)); }
            set { SetData(HrEmployeeIoRecordTable.C_CAR_NO, value); }
        }

        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_STATUS)); }
            set { SetData(HrEmployeeIoRecordTable.C_STATUS, value); }
        }

        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeIoRecordTable.C_CREATED_DATE)); }
            set { SetData(HrEmployeeIoRecordTable.C_CREATED_DATE, value); }
        }

        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_CREATED_BY)); }
            set { SetData(HrEmployeeIoRecordTable.C_CREATED_BY, value); }
        }

        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(HrEmployeeIoRecordTable.C_UPDATED_DATE)); }
            set { SetData(HrEmployeeIoRecordTable.C_UPDATED_DATE, value); }
        }

        [DataMember]
        public string UpdatedBy
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_UPDATED_BY)); }
            set { SetData(HrEmployeeIoRecordTable.C_UPDATED_BY, value); }
        }

        [DataMember]
        public string DeptLeaderDesc
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_DEPT_LEADER_DESC)); }
            set { SetData(HrEmployeeIoRecordTable.C_DEPT_LEADER_DESC, value); }
        }

        [DataMember]
        public string HrLeaderDesc
        {
            get { return Convert.ToString(GetData(HrEmployeeIoRecordTable.C_HR_LEADER_DESC)); }
            set { SetData(HrEmployeeIoRecordTable.C_HR_LEADER_DESC, value); }
        }

        #endregion
    }
}
